<div class="content-section introduction">
  <div>
    <div>
      <span class="feature-title">基础数据<span class="gt">&gt;</span>库房管理</span>
    </div>
  </div>
</div>
<div class="content-section implementation GridDemo" id="malfunctionBasalDatas">
  <div class="ui-grid-row">
    <div class="ui-grid-col-6">
      <h4>数据配置</h4>
      <p-tree [value]="malfunctionDatas"
              selectionMode="single"
              [(selection)]="selected"
              (onNodeExpand)="nodeExpand($event)"
              (onNodeSelect) = "NodeSelect($event)"
      ></p-tree>
    </div>
    <div class="ui-grid-col-6">
      <h4>{{ titleName }}</h4>
      <div class="ui-grid-row text_aligin_right">
        <button pButton type="button" class="btn_add" (click)="add()" label="新增" icon="fa-plus" [disabled]="canAdd"></button>
        <p-dataTable id="manageTable" class="report" [value]="inventoryModel" [lazy]="true" [rows]="10" [paginator]="true" [rowsPerPageOptions]="[5,10,20]"
                     [totalRecords]="totalRecords" (onLazyLoad)="loadCarsLazy($event)" [stacked]="stacked" [responsive]="true" [editable]="true">
          <p-column selectionMode="multiple" ></p-column>
          <p-column field="label" header="名称" [sortable]="true"></p-column>
          <p-column field="remark" header="警界数量" [sortable]="true" *ngIf="Police == 1.002"></p-column>
          <p-column field="status" header="状态" [sortable]="true"></p-column>
          <p-column field="color" header="操作" [style]="{'width':'12vw'}">
            <ng-template let-datas="rowData" pTemplate="operator">
              <button pButton type="button"  (click)="edit(datas)" label="编辑"></button>
              <button pButton type="button"  (click)="frezzeOrActive(datas)" label="启用"  *ngIf="datas.status == '冻结'"></button>
              <button pButton type="button"  (click)="frezzeOrActive(datas)" label="冻结"  *ngIf="datas.status == '启用'"></button>
              <button pButton type="button"  (click)="delete(datas)" label="删除" ></button>
              <button pButton type="button"  (click)="view(datas)" label="查看"   ></button>
            </ng-template>
          </p-column>
          <ng-template pTemplate="emptymessage">
            当前没有数据
          </ng-template>
        </p-dataTable>
      </div>
    </div>
  </div>

  <p-dialog header="{{ title }}" [(visible)]="addDisplay" modal="modal" width="500" [responsive]="true">
    <div class="ui-grid-row">
      <p-messages [(value)]="msgs"></p-messages>
      <form [formGroup]="myForm">
        <div class="ui-grid-col-12">
          <div class="ui-grid-col-2">
            <label for="">名称</label>
          </div>
          <div class="ui-grid-col-10">
            <input  formControlName="nodeName" type="text" pInputText  [style.width.%]="90" placeholder="请输入名称" [(ngModel)]="dataName" required="required"  [class.my-dirty]="isDirty"/>
          </div>
        </div>
        <div class="ui-grid-col-12" style="height: 10px"></div>
        <div class="ui-grid-col-12">
          <div class="ui-grid-col-2">
            <label for="">警界数量</label>
          </div>
          <div class="ui-grid-col-10">
            <input  formControlName="remark" type="text" pInputText  [style.width.%]="90" placeholder="请输入警界数量" [(ngModel)]="remarks" required="required"  [class.my-dirty]="isDirty"/>
          </div>
        </div>
        <div class="ui-grid-col-12" style="height: 10px"></div>

        <div class="ui-grid-col-12">
          <div class="ui-grid-col-2">
            <label for="">状态</label>
          </div>
          <div class="ui-grid-col-10">
            <p-radioButton formControlName="nodeActive" name="group" value="启用" label="启用" [(ngModel)]="val1" inputId="preopt3"></p-radioButton>
            <p-radioButton formControlName="nodeUnactive" name="group" value="冻结" label="冻结" [(ngModel)]="val1" inputId="preopt4"></p-radioButton>
          </div>
        </div>
      </form>

    </div>
    <p-footer>
      <button type="button" pButton icon="fa-check" (click)="ansureAddDialog()" label="新增" *ngIf="addOrEdit == 'add'"></button>
      <button type="button" pButton icon="fa-check" (click)="ansureEditDialog()" label="编辑" *ngIf="addOrEdit == 'edit'"></button>
      <button type="button" pButton icon="fa-close" (click)="cancelMask(false)" label="取消"></button>
    </p-footer>
  </p-dialog>
  <p-dialog header="删除确认框" [(visible)]="dialogDisplay" modal="modal" width="300" [responsive]="true">
    确认删除吗？
    <p-footer>
      <button type="button" pButton icon="fa-check" (click)="sureDelete()" label="确定"></button>
      <button type="button" pButton icon="fa-close" (click)="dialogDisplay=false" label="取消" class="ui-button-secondary"></button>
    </p-footer>
  </p-dialog>
  <p-growl [(value)]="msgPop"></p-growl>
</div>
